home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / pc / ps40sdk / examples / import / gradientimport / common / gradientimport.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-13  |  4.3 KB  |  170 lines

  1. /*
  2.     File: GradientImport.h
  3.  
  4.     Copyright ⌐ 1993-6, Adobe Systems Incorporated.
  5.     All rights reserved.
  6.  
  7.     Utilities for import modules.
  8. */
  9.  
  10. #ifndef __GradientImport_H__
  11. #define __GradientImport_H__
  12.  
  13. #include "PIAcquire.h"
  14. #include "PIUtilities.h"
  15.  
  16. /*****************************************************************************/
  17. /* Scripting keys.                                                             */
  18.  
  19. #define keyMultiImportInfo                'mulK'
  20. #define classMultiImportStruct            'mulS'
  21. #define typeClassMultiImportStruct        'mulT'
  22. #define keyMultiImportCount                keyMultiImportInfo // 'mulC'
  23. #define keyOurMode                        keyMode
  24. #define keyRows                            keyHorizontal
  25. #define keyColumns                        keyVertical
  26. #define typeGradientMode                'grmT'
  27.     #define ourBitmapMode                'bitM'
  28.     #define ourGrayscaleMode            'gryS'
  29.     #define ourIndexedColorMode            'indX'
  30.     #define ourRGBColorMode                'rgbC'
  31.     
  32. /*****************************************************************************/
  33. /* Dialog constants.                                                         */
  34.  
  35. #define dRowsItem        3
  36. #define dColsItem        4
  37. #define dFirstModeItem    5
  38. #define dLastModeItem    8
  39. #define dInvertItem     9
  40. #define dModeGroupItem  12
  41. #define kProxyItem        13 // later implementation
  42.  
  43. /*****************************************************************************/
  44. /* Value bounds.                                                             */
  45.  
  46. #define kRowsMin            1
  47. #define kRowsMax            30000
  48. #define kColumnsMin            1
  49. #define kColumnsMax            30000
  50. #define kMinDescriptors        1
  51. #define kMaxDescriptors        50
  52.  
  53. #define kGutter                2            // 2 pixel gutter
  54.  
  55. #define errHowdWeGetHere    16989
  56.  
  57. /*****************************************************************************/
  58. /* The region of the image being acquired (an area and a range of planes).   */
  59.  
  60. typedef struct AcquireRegion
  61.     {
  62.     Rect rect;
  63.     int16 loPlane;
  64.     int16 hiPlane;
  65.     }
  66. AcquireRegion;
  67.  
  68. /* The layout of the data.                                                   */
  69.  
  70. typedef struct AcquireDataLayout
  71.     {
  72.     int32 rowBytes;
  73.     int32 colBytes;
  74.     int32 planeBytes;
  75.     }
  76. AcquireDataLayout;
  77.     
  78. /*****************************************************************************/
  79.  
  80. OSErr StoreData (AcquireRecord *stuff,
  81.                  void *data,
  82.                  AcquireRegion *region,
  83.                  AcquireDataLayout *layout);
  84.  
  85. OSErr FetchData (AcquireRecord *stuff,
  86.                  void *data,
  87.                  AcquireRegion *region,
  88.                  AcquireDataLayout *layout);
  89.  
  90. /*****************************************************************************/
  91.  
  92. extern Handle hDllInstance;
  93.  
  94. typedef struct Globals
  95.     {
  96.  
  97.     short result;
  98.     AcquireRecord *stuff;
  99.     
  100.     #if Macintosh
  101.     DialogPtr dialog;
  102.     DialogTHndl dialogHdl;
  103.     #else
  104.     HWND    dialog;
  105.     #endif
  106.     
  107.     short         lastImages;
  108.     short         lastRows;
  109.     short         lastCols;
  110.     short         lastMode;
  111.     Boolean     lastInvert;
  112.     Boolean     queryForParameters;
  113.     Boolean     initParameters;
  114.     Boolean     continueImport;
  115.     
  116.     short         nextImage;
  117.     
  118.     /* scripting info */
  119.  
  120.     uint32                count;
  121.     
  122.     PIReadDescriptor    token;
  123.     PIDescriptorHandle    array [kMaxDescriptors];
  124.     
  125.     } Globals, *GPtr, **GHdl;
  126.  
  127. /*****************************************************************************/
  128.  
  129. #define gResult (globals->result)
  130. #define gStuff  (globals->stuff)
  131.  
  132. #define gDialog (globals->dialog)
  133. #define gDialogHdl (globals->dialogHdl)
  134.  
  135. #define gLastImages (globals->lastImages)
  136. #define gLastRows (globals->lastRows)
  137. #define gLastCols (globals->lastCols)
  138. #define gLastMode (globals->lastMode)
  139. #define gLastInvert (globals->lastInvert)
  140.  
  141. #define gNextImage (globals->nextImage)
  142.  
  143. #define gQueryForParameters (globals->queryForParameters)
  144. #define gInitParameters (globals->initParameters)
  145. #define gContinueImport (globals->continueImport)
  146.  
  147. #define gCount (globals->count)
  148. #define gArray (globals->array)
  149. #define gToken (globals->token)
  150.  
  151. /*****************************************************************************/
  152.  
  153. void DoAbout (GPtr globals);
  154. void OpenScriptParams (GPtr globals);
  155. void ReadScriptParams (GPtr globals);
  156. void CloseScriptParams (GPtr globals);
  157. OSErr WriteScriptParams (GPtr globals);
  158. OSType GetGradientMode (short plugInMode);
  159. short GetPlugInMode (OSType gradientMode);
  160. Boolean OpenOurDialog (GPtr globals);
  161. Boolean RunOurDialog (GPtr globals);
  162. void CloseOurDialog (GPtr globals);
  163. void CreateDescriptor (GPtr globals);
  164. void SwitchScriptInfo (GPtr globals, PIReadDescriptor readToken);
  165. OSErr CheckAndWriteScriptParams (GPtr globals);
  166. void GetProxyItemRect (HWND    hDlg, Rect *proxyItemRect);
  167.  
  168. /*****************************************************************************/
  169.  
  170. #endif /* __GradientImport_H__ */